package c.e.a.b.b.g.a;

import android.content.Context;
import android.content.res.Resources;
import android.text.TextUtils;
import c.e.a.b.b.h.u;
import com.google.android.gms.common.api.Status;
import javax.annotation.concurrent.GuardedBy;

@Deprecated
public final class b {
    public static final Object d = new Object();
    @GuardedBy("sLock")
    public static b e;
    public final String a;
    public final Status b;
    public final boolean c;

    public b(Context context) {
        Resources resources = context.getResources();
        int identifier = resources.getIdentifier("google_app_measurement_enable", "integer", resources.getResourcePackageName(2131689759));
        int i = 0;
        if (identifier != 0) {
            if (resources.getInteger(identifier) != 0) {
                i = 1;
            }
            this.c = i ^ 1;
        } else {
            this.c = false;
        }
        u.a(context);
        CharSequence charSequence = u.c;
        if (charSequence == null) {
            Resources resources2 = context.getResources();
            int identifier2 = resources2.getIdentifier("google_app_id", "string", resources2.getResourcePackageName(2131689759));
            if (identifier2 == 0) {
                charSequence = null;
            } else {
                charSequence = resources2.getString(identifier2);
            }
        }
        if (TextUtils.isEmpty(charSequence)) {
            this.b = new Status(10, "Missing google app id value from from string resources with name google_app_id.");
            this.a = null;
            return;
        }
        this.a = charSequence;
        this.b = Status.e;
    }

    public static b a(String str) {
        b bVar;
        synchronized (d) {
            bVar = e;
            if (bVar != null) {
            } else {
                StringBuilder stringBuilder = new StringBuilder(str.length() + 34);
                stringBuilder.append("Initialize must be called before ");
                stringBuilder.append(str);
                stringBuilder.append(".");
                throw new IllegalStateException(stringBuilder.toString());
            }
        }
        return bVar;
    }
}
